﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using RepositoryFramework;

namespace Portal.Repository.SkillsCatalog
{
	/// <summary>
	/// Class <see cref="UnitOfWork"/> define skills catalog unit of work
	/// </summary>
	public class SkillsCatalogUnitOfWork : UnitOfWork<SkillsCatalogEntities>, ISkillsCatalogUnitOfWork, IDisposable
	{
		#region Fields
		private ICurriculumVitaeRepository _curriculumVitaeRepository;
		#endregion

		#region Properties
		/// <summary>
		/// Gets the curriculum vitae repository.
		/// </summary>
		/// <value>
		/// The curriculum vitae repository.
		/// </value>
		public ICurriculumVitaeRepository CurriculumVitaeRepository
		{
			get
			{
				if (_curriculumVitaeRepository == null)
				{
					_curriculumVitaeRepository = new CurriculumVitaeRepository(Context);
				}
				return _curriculumVitaeRepository;
			}
		}
		#endregion

		#region .ctor
		/// <summary>
		/// Initializes a new instance of the <see cref="SkillsCatalogUnitOfWork"/> class.
		/// </summary>
		public SkillsCatalogUnitOfWork()
			: base(new SkillsCatalogEntities())
		{
		}
		#endregion

	}
}
